import { defHttp } from '@/utils/http/axios'
import type { DeptAddReq, DeptDeleteReq, DeptQuery, DeptUpdateReq } from '@/model/sys/deptModel'

enum Path {
  Tree = '/dept/tree',
  Add = '/dept/add',
  Update = '/dept/update',
  Delete = '/dept/delete',
}

export const deptApi = {
  tree(params?: DeptQuery) {
    return defHttp.post({ url: Path.Tree, params })
  },
  add(params: DeptAddReq) {
    return defHttp.post({ url: Path.Add, params })
  },
  update(params: DeptUpdateReq) {
    return defHttp.post({ url: Path.Update, params })
  },
  delete(params: DeptDeleteReq) {
    return defHttp.post({ url: Path.Delete, params })
  },
}
